import axios from '@/axios'

// 新增项目成员
export function tcProjectMember() {
  return axios({
    url: '/task/tcProjectMember',
    method: 'post',
  })
}

// 获取项目成员
export function getProjectMember(params) {
  return axios({
    url: '/task/tcProjectMember/list',
    method: 'get',
    params,
  })
}

/* 任务工程 */
// 查询项目组树
export function getTcTaskProjectList(params) {
  return axios({
    url: '/task/tcTaskProject/list',
    method: 'get',
    params,
  })
}

// 新增项目组/项目
export function addTcTaskProject(data) {
  return axios({
    url: '/task/tcTaskProject',
    method: 'post',
    data,
  })
}

// 修改项目组/项目
export function editTcTaskProject(data) {
  return axios({
    url: '/task/tcTaskProject',
    method: 'put',
    data,
  })
}

// 获取项目组/项目详情信息
export function getProjectDetail(projectId) {
  return axios({
    url: '/task/tcTaskProject/' + projectId,
    method: 'get',
  })
}

// 删除项目
export function deleteProject(projectIds) {
  return axios({
    url: `/task/tcTaskProject/${projectIds}`,
    method: 'delete',
  })
}

// 获取项目根阶段
export function getRootItemList(data) {
  return axios({
    url: '/task/tcTaskItems/itemList',
    method: 'post',
    data,
  })
}

// 获取项目组
export function getTcTaskProjectParentList() {
  return axios({
    url: '/task/tcTaskProject/parentList',
    method: 'get',
  })
}

// 获取项目
export function getTcTaskProjectSelectList() {
  return axios({
    url: '/task/tcTaskProject/selectList',
    method: 'get',
  })
}

// 获取当前用户参与的项目
export function getProjectListByUser() {
  return axios({
    url: '/task/tcTaskProject/selectByLoginUserId',
    method: 'get',
  })
}
